<?
include("config.php");

$s = mssql_query("DROP VIEW VRepPendidikan");

/*
SELECT     A.NIK, B.jurusan, B.keterangan, 
                      CASE keterangan WHEN 'SD' THEN '1' WHEN 'SD Lain-lain' THEN '1' WHEN 'SMP' THEN '2' WHEN 'SMP Lain-lain' THEN '2' WHEN 'SMA' THEN '3' WHEN
                       'SMEA' THEN '3' WHEN 'SMK' THEN '3' WHEN 'SMKK' THEN '3' WHEN 'ST' THEN '3' WHEN 'STM' THEN '3' WHEN 'D1' THEN '4' WHEN 'D2' THEN '5'
                       WHEN 'D3' THEN '6' WHEN 'D4' THEN '7' WHEN 'S1' THEN '8' WHEN 'S2' THEN '9' WHEN 'S3' THEN '10' END AS SeqNo
FROM         dbo.Pendidikan AS A INNER JOIN
                      dbo.MstPendidikan AS B ON A.Pend_ID = B.Pend_ID
*/

if($s){
	$q = mssql_query("Create View VRepPendidikan as SELECT A.NIK, B.jurusan, B.keterangan, CASE keterangan WHEN 'SD' THEN '1' WHEN 'SD Lain-lain' THEN '1' WHEN 'SMP' THEN '2' WHEN 'SMP Lain-lain' THEN '2' WHEN 'SMA' THEN '3' WHEN 'SMEA' THEN '3' WHEN 'SMK' THEN '3' WHEN 'SMKK' THEN '3' WHEN 'ST' THEN '3' WHEN 'STM' THEN '3' WHEN 'D1' THEN '4' WHEN 'D2' THEN '5' WHEN 'D3' THEN '6' WHEN 'D4' THEN '7' WHEN 'S1' THEN '8' WHEN 'S2' THEN '9' WHEN 'S3' THEN '10' END AS SeqNo FROM dbo.Pendidikan AS A INNER JOIN        dbo.MstPendidikan AS B ON A.Pend_ID = B.Pend_ID");
	if($q){
		echo"Update View Rep Pendidikan OK, Thank You";
	}

}					  
?>